

package jetbrains.buildServer.server.graphql.resolver.agentPool;

import jetbrains.buildServer.server.graphql.model.agentPool.AbstractAgentPool;
import jetbrains.buildServer.server.graphql.model.agentPool.ProjectAgentPool;
import jetbrains.buildServer.serverSide.agentPools.AgentPool;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Component;

@Component
public class AbstractAgentPoolFactory {
  public AbstractAgentPool produce(@NotNull AgentPool realPool) {
    if(realPool.isProjectPool()) {
      return new ProjectAgentPool(realPool);
    }

    return new jetbrains.buildServer.server.graphql.model.agentPool.AgentPool(realPool);
  }
}